﻿using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using EcoSystem.Permissions;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp;
using Volo.Abp.Application.Dtos;

namespace EcoSystem;

/// <summary>
/// 页面通知消息管理
/// </summary>
[Area(EcoSystemRemoteServiceConsts.ModuleName)]
[RemoteService(Name = EcoSystemRemoteServiceConsts.RemoteServiceName)]
[Route("api/Platform/notification")]
public class NotificationController : EcoSystemController
{
    private readonly INotificationAppService _service;

    public NotificationController(INotificationAppService service)
    {
        _service = service;
    }

    /// <summary>
    /// 列表查询
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    [HttpGet]
    public async Task<PagedResultDto<NotificationDto>> GetListAsync(GetNotificationInput input)
    {
        return await _service.GetListAsync(input);
    }

    /// <summary>
    /// 获取所有
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    [HttpGet]
    [Route("all")]
    public async Task<List<NotificationDto>> GetAllListAsync(GetNotificationInput input)
    {
        return await _service.GetAllListAsync(input);
    }

    /// <summary>
    /// 删除
    /// </summary>
    /// <param name="id"></param>
    /// <returns></returns>
    [HttpDelete]
    [Route("{id}")]
    public async Task DeleteAsync(Guid id)
    {
        await _service.DeleteAsync(id);
    }

    /// <summary>
    /// 
    /// </summary>
    /// <param name="id"></param>
    /// <returns></returns>
    /// <exception cref="NotImplementedException"></exception>
    [HttpPut]
    [Route("setRead/{id}")]
    public Task SetReadAsync(Guid id)
    {
        throw new NotImplementedException();
    }

    /// <summary>
    /// 
    /// </summary>
    /// <returns></returns>
    /// <exception cref="NotImplementedException"></exception>
    [HttpPut]
    [Route("readAll")]
    public Task<int> ReadAllAsync()
    {
        throw new NotImplementedException();
    }

    /// <summary>
    /// 
    /// </summary>
    /// <returns></returns>
    /// <exception cref="NotImplementedException"></exception>
    [HttpDelete]
    [Route("clearAll")]
    public Task<int> ClearAllAsync()
    {
        throw new NotImplementedException();
    }
}
